<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Jurisdictions | Fans</title>
    <meta name="description" content="The Fans app REST API docs.">
    <link rel="shortcut icon" href="/docs/favicon.ico">
  <link rel="icon" href="/docs/fans.svg">
  <link rel="mask-icon" href="/docs/fans.svg">
    
    <link rel="preload" href="/docs/assets/css/0.styles.96586f63.css" as="style"><link rel="preload" href="/docs/assets/js/app.adb254f4.js" as="script"><link rel="preload" href="/docs/assets/js/2.0613674a.js" as="script"><link rel="preload" href="/docs/assets/js/12.7e19e4ef.js" as="script"><link rel="prefetch" href="/docs/assets/js/10.443b0da9.js"><link rel="prefetch" href="/docs/assets/js/11.5914f244.js"><link rel="prefetch" href="/docs/assets/js/13.bf31197c.js"><link rel="prefetch" href="/docs/assets/js/14.325025c5.js"><link rel="prefetch" href="/docs/assets/js/15.fe04ddd5.js"><link rel="prefetch" href="/docs/assets/js/16.db0ffebf.js"><link rel="prefetch" href="/docs/assets/js/3.f7ca2ebe.js"><link rel="prefetch" href="/docs/assets/js/4.c9eaa668.js"><link rel="prefetch" href="/docs/assets/js/5.19f5b095.js"><link rel="prefetch" href="/docs/assets/js/6.28cd1744.js"><link rel="prefetch" href="/docs/assets/js/7.407974dd.js"><link rel="prefetch" href="/docs/assets/js/8.5d06e407.js"><link rel="prefetch" href="/docs/assets/js/9.08fd7d8a.js">
    <link rel="stylesheet" href="/docs/assets/css/0.styles.96586f63.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/docs/" class="home-link router-link-active"><!----> <span class="site-name">Fans</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/docs/" class="nav-link">Home</a></div><div class="nav-item"><a href="/docs/api/" class="nav-link router-link-active">Docs</a></div><div class="nav-item"><a href="https://github.com/medz/fans" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/docs/" class="nav-link">Home</a></div><div class="nav-item"><a href="/docs/api/" class="nav-link router-link-active">Docs</a></div><div class="nav-item"><a href="https://github.com/medz/fans" target="_blank" rel="noopener noreferrer" class="nav-link external">
  GitHub
  <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Kernel</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/api/" class="sidebar-link">Overview</a></li><li><a href="/docs/api/authorizations.html" class="sidebar-link">Authorizations</a></li><li><a href="/docs/api/comments.html" class="sidebar-link">Comments</a></li><li><a href="/docs/api/itc.html" class="sidebar-link">International Telephone Codes</a></li><li><a href="/docs/api/jurisdictions.html" class="active sidebar-link">Jurisdictions</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/docs/api/jurisdictions.html#get-all-and-user-jurisdictions" class="sidebar-link">Get all and user jurisdictions</a></li><li class="sidebar-sub-header"><a href="/docs/api/jurisdictions.html#sync-user-all-jurisdictions" class="sidebar-link">Sync user all jurisdictions</a></li><li class="sidebar-sub-header"><a href="/docs/api/jurisdictions.html#attach-a-single-jurisdiction-on-an-user" class="sidebar-link">Attach a single jurisdiction on an user</a></li><li class="sidebar-sub-header"><a href="/docs/api/jurisdictions.html#detach-a-single-jurisdiction-on-an-user" class="sidebar-link">Detach a single jurisdiction on an user</a></li></ul></li><li><a href="/docs/api/talks.html" class="sidebar-link">Talks</a></li><li><a href="/docs/api/upload.html" class="sidebar-link">Upload File</a></li><li><a href="/docs/api/users.html" class="sidebar-link">Users</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Forum</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/docs/api/forum/nodes.html" class="sidebar-link">Nodes</a></li><li><a href="/docs/api/forum/threads.html" class="sidebar-link">Threads</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="content default"><p>The App does not have the concept of &quot;background management&quot;. All data is judged by the client using Jurisdictions, and the corresponding permission function appears. Therefore, after the user logs in to the application, the App should obtain the user's Jurisdictions for function implementation.</p> <p></p><div class="table-of-contents"><ul><li><a href="#get-all-and-user-jurisdictions">Get all and user jurisdictions</a></li><li><a href="#sync-user-all-jurisdictions">Sync user all jurisdictions</a></li><li><a href="#attach-a-single-jurisdiction-on-an-user">Attach a single jurisdiction on an user</a></li><li><a href="#detach-a-single-jurisdiction-on-an-user">Detach a single jurisdiction on an user</a></li></ul></div><p></p> <h2 id="get-all-and-user-jurisdictions"><a href="#get-all-and-user-jurisdictions" aria-hidden="true" class="header-anchor">#</a> Get all and user jurisdictions</h2> <div class="language- extra-class"><pre class="language-text"><code>GET {uri}/jurisdictions
</code></pre></div><p>Response:</p> <div class="language-json extra-class"><pre class="language-json"><code>Status<span class="token operator">:</span> <span class="token number">200</span> OK
<span class="token punctuation">{</span>
    <span class="token property">&quot;all&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;node&quot;</span><span class="token operator">:</span> <span class="token string">&quot;forum:threads-manage&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Forum &gt; Threads Manage&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;desc&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Manage Forum Threads&quot;</span>
        <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;node&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user:jurisdiction&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;User &gt; Jurisdiction&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;desc&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Change User Jurisdiction Nodes&quot;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span><span class="token punctuation">,</span>
    <span class="token property">&quot;user&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span>
            <span class="token property">&quot;node&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user:jurisdiction&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;name&quot;</span><span class="token operator">:</span> <span class="token string">&quot;User &gt; Jurisdiction&quot;</span><span class="token punctuation">,</span>
            <span class="token property">&quot;desc&quot;</span><span class="token operator">:</span> <span class="token string">&quot;Change User Jurisdiction Nodes&quot;</span>
        <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><h2 id="sync-user-all-jurisdictions"><a href="#sync-user-all-jurisdictions" aria-hidden="true" class="header-anchor">#</a> Sync user all jurisdictions</h2> <div class="warning custom-block"><p class="custom-block-title">WARNING</p> <p>Need jurisdiction:<code>user:jurisdiction</code></p></div> <div class="language- extra-class"><pre class="language-text"><code>PUT {uri}/users/{user}/jurisdictions
</code></pre></div><p>Input:</p> <table><thead><tr><th>Name</th> <th>Type</th> <th>Description</th></tr></thead> <tbody><tr><td><code>nodes</code></td> <td><code>array&lt;object&gt;</code></td> <td>Nodes that need to be synchronized.</td></tr></tbody></table> <p>E.g:</p> <div class="language-json extra-class"><pre class="language-json"><code><span class="token punctuation">{</span>
    <span class="token property">&quot;nodes&quot;</span><span class="token operator">:</span> <span class="token punctuation">[</span>
        <span class="token punctuation">{</span> <span class="token property">&quot;node&quot;</span><span class="token operator">:</span> <span class="token string">&quot;forum:threads-manage&quot;</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
        <span class="token punctuation">{</span> <span class="token property">&quot;node&quot;</span><span class="token operator">:</span> <span class="token string">&quot;user:jurisdiction&quot;</span> <span class="token punctuation">}</span>
    <span class="token punctuation">]</span>
<span class="token punctuation">}</span>
</code></pre></div><p>Response:</p> <div class="language- extra-class"><pre class="language-text"><code>Status: 204 No Content
</code></pre></div><h2 id="attach-a-single-jurisdiction-on-an-user"><a href="#attach-a-single-jurisdiction-on-an-user" aria-hidden="true" class="header-anchor">#</a> Attach a single jurisdiction on an user</h2> <div class="warning custom-block"><p class="custom-block-title">WARNING</p> <p>Need jurisdiction:<code>user:jurisdiction</code></p></div> <div class="language- extra-class"><pre class="language-text"><code>PUT {uri}/users/{user}/jurisdictions/{node}
</code></pre></div><p>Response:</p> <div class="language- extra-class"><pre class="language-text"><code>Status: 204 No Content
</code></pre></div><h2 id="detach-a-single-jurisdiction-on-an-user"><a href="#detach-a-single-jurisdiction-on-an-user" aria-hidden="true" class="header-anchor">#</a> Detach a single jurisdiction on an user</h2> <div class="warning custom-block"><p class="custom-block-title">WARNING</p> <p>Need jurisdiction:<code>user:jurisdiction</code></p></div> <div class="language- extra-class"><pre class="language-text"><code>DELETE {uri}/users/{user}/jurisdictions/{node}
</code></pre></div><p>Response:</p> <div class="language- extra-class"><pre class="language-text"><code>Status: 204 No Content
</code></pre></div></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
        ←
        <a href="/docs/api/itc.html" class="prev">
          International Telephone Codes
        </a></span> <span class="next"><a href="/docs/api/talks.html">
          Talks
        </a>
        →
      </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/docs/assets/js/app.adb254f4.js" defer></script><script src="/docs/assets/js/2.0613674a.js" defer></script><script src="/docs/assets/js/12.7e19e4ef.js" defer></script>
  </body>
</html>
